<template>
  <div class="cart">
    <div class="fixed">
      <div class="header">
        <span class="left">购物车</span><span class="right">领劵<span class="edit">编辑</span></span>
      </div>
    </div>
    <div class="servicePolicy">
      <span><i></i>30天无忧退货</span>
      <span><i></i>48小时快速退款</span>
      <span><i></i>满99元免邮费</span>
    </div>
    <div class="ad">
      <div class="promotion">
        <span class="left">全场换购</span>
        <span class="mid">再购1件享低至五折超值换购</span>
        <span class="right">去凑单&nbsp;></span>
      </div>
      <div class="change">
        <span>查看换购商品</span>
        <span> ></span>
      </div>
    </div>
    <div class="cartList">
      <van-swipe-cell>
        <div class="cartListItem">
          <div class="checkbox"><van-checkbox v-model="checked" checked-color="#ee0a24"></van-checkbox></div>
          <van-card price="2.00" thumb="https://img01.yzcdn.cn/vant/ipad.jpeg">
            <template #title>
              <span class="buy">特价抢购中 </span>
              <span class="beforeEnd"> 距离优惠结束</span>
              <span class="end">5天13小时</span>
            </template>
            <template #desc>
              <div class="desc"><span class="discount">限时优惠</span></div>
            </template>
            <template #num>
              <van-stepper v-model="value" />
            </template>
          </van-card>
        </div>
        <template #right>
          <van-button square type="danger" text="删除" class="delete-button" />
        </template>
      </van-swipe-cell>
      <van-swipe-cell>
        <div class="cartListItem">
          <div class="checkbox"><van-checkbox v-model="checked" checked-color="#ee0a24"></van-checkbox></div>
          <van-card price="2.00" thumb="https://img01.yzcdn.cn/vant/ipad.jpeg">
            <template #title>
              <span class="buy">特价抢购中 </span>
              <span class="beforeEnd"> 距离优惠结束</span>
              <span class="end">5天13小时</span>
            </template>
            <template #desc>
              <div class="desc"><span class="discount">限时优惠</span></div>
            </template>
            <template #num>
              <van-stepper v-model="value" />
            </template>
          </van-card>
        </div>
        <template #right>
          <van-button square type="danger" text="删除" class="delete-button" />
        </template>
      </van-swipe-cell>
      <van-swipe-cell>
        <div class="cartListItem">
          <div class="checkbox"><van-checkbox v-model="checked" checked-color="#ee0a24"></van-checkbox></div>
          <van-card price="2.00" thumb="https://img01.yzcdn.cn/vant/ipad.jpeg">
            <template #title>
              <span class="buy">特价抢购中 </span>
              <span class="beforeEnd"> 距离优惠结束</span>
              <span class="end">5天13小时</span>
            </template>
            <template #desc>
              <div class="desc"><span class="discount">限时优惠</span></div>
            </template>
            <template #num>
              <van-stepper v-model="value" />
            </template>
          </van-card>
        </div>
        <template #right>
          <van-button square type="danger" text="删除" class="delete-button" />
        </template>
      </van-swipe-cell>
      <van-swipe-cell>
        <div class="cartListItem">
          <div class="checkbox"><van-checkbox v-model="checked" checked-color="#ee0a24"></van-checkbox></div>
          <van-card price="2.00" thumb="https://img01.yzcdn.cn/vant/ipad.jpeg">
            <template #title>
              <span class="buy">特价抢购中 </span>
              <span class="beforeEnd"> 距离优惠结束</span>
              <span class="end">5天13小时</span>
            </template>
            <template #desc>
              <div class="desc"><span class="discount">限时优惠</span></div>
            </template>
            <template #num>
              <van-stepper v-model="value" />
            </template>
          </van-card>
        </div>
        <template #right>
          <van-button square type="danger" text="删除" class="delete-button" />
        </template>
      </van-swipe-cell>
      <van-swipe-cell>
        <div class="cartListItem">
          <div class="checkbox"><van-checkbox v-model="checked" checked-color="#ee0a24"></van-checkbox></div>
          <van-card price="2.00" thumb="https://img01.yzcdn.cn/vant/ipad.jpeg">
            <template #title>
              <span class="buy">特价抢购中 </span>
              <span class="beforeEnd"> 距离优惠结束</span>
              <span class="end">5天13小时</span>
            </template>
            <template #desc>
              <div class="desc"><span class="discount">限时优惠</span></div>
            </template>
            <template #num>
              <van-stepper v-model="value" />
            </template>
          </van-card>
        </div>
        <template #right>
          <van-button square type="danger" text="删除" class="delete-button" />
        </template>
      </van-swipe-cell>
      <van-swipe-cell>
        <div class="cartListItem">
          <div class="checkbox"><van-checkbox v-model="checked" checked-color="#ee0a24"></van-checkbox></div>
          <van-card price="2.00" thumb="https://img01.yzcdn.cn/vant/ipad.jpeg">
            <template #title>
              <span class="buy">特价抢购中 </span>
              <span class="beforeEnd"> 距离优惠结束</span>
              <span class="end">5天13小时</span>
            </template>
            <template #desc>
              <div class="desc"><span class="discount">限时优惠</span></div>
            </template>
            <template #num>
              <van-stepper v-model="value" />
            </template>
          </van-card>
        </div>
        <template #right>
          <van-button square type="danger" text="删除" class="delete-button" />
        </template>
      </van-swipe-cell>
      <van-swipe-cell>
        <div class="cartListItem">
          <div class="checkbox"><van-checkbox v-model="checked" checked-color="#ee0a24"></van-checkbox></div>
          <van-card price="2.00" thumb="https://img01.yzcdn.cn/vant/ipad.jpeg">
            <template #title>
              <span class="buy">特价抢购中 </span>
              <span class="beforeEnd"> 距离优惠结束</span>
              <span class="end">5天13小时</span>
            </template>
            <template #desc>
              <div class="desc"><span class="discount">限时优惠</span></div>
            </template>
            <template #num>
              <van-stepper v-model="value" />
            </template>
          </van-card>
        </div>
        <template #right>
          <van-button square type="danger" text="删除" class="delete-button" />
        </template>
      </van-swipe-cell>
      <van-swipe-cell>
        <div class="cartListItem">
          <div class="checkbox"><van-checkbox v-model="checked" checked-color="#ee0a24"></van-checkbox></div>
          <van-card price="2.00" thumb="https://img01.yzcdn.cn/vant/ipad.jpeg">
            <template #title>
              <span class="buy">特价抢购中 </span>
              <span class="beforeEnd"> 距离优惠结束</span>
              <span class="end">5天13小时</span>
            </template>
            <template #desc>
              <div class="desc"><span class="discount">限时优惠</span></div>
            </template>
            <template #num>
              <van-stepper v-model="value" />
            </template>
          </van-card>
        </div>
        <template #right>
          <van-button square type="danger" text="删除" class="delete-button" />
        </template>
      </van-swipe-cell>
      <van-swipe-cell>
        <div class="cartListItem">
          <div class="checkbox"><van-checkbox v-model="checked" checked-color="#ee0a24"></van-checkbox></div>
          <van-card price="2.00" thumb="https://img01.yzcdn.cn/vant/ipad.jpeg">
            <template #title>
              <span class="buy">特价抢购中 </span>
              <span class="beforeEnd"> 距离优惠结束</span>
              <span class="end">5天13小时</span>
            </template>
            <template #desc>
              <div class="desc"><span class="discount">限时优惠</span></div>
            </template>
            <template #num>
              <van-stepper v-model="value" />
            </template>
          </van-card>
        </div>
        <template #right>
          <van-button square type="danger" text="删除" class="delete-button" />
        </template>
      </van-swipe-cell>
      <van-swipe-cell>
        <div class="cartListItem">
          <div class="checkbox"><van-checkbox v-model="checked" checked-color="#ee0a24"></van-checkbox></div>
          <van-card price="2.00" thumb="https://img01.yzcdn.cn/vant/ipad.jpeg">
            <template #title>
              <span class="buy">特价抢购中 </span>
              <span class="beforeEnd"> 距离优惠结束</span>
              <span class="end">5天13小时</span>
            </template>
            <template #desc>
              <div class="desc"><span class="discount">限时优惠</span></div>
            </template>
            <template #num>
              <van-stepper v-model="value" />
            </template>
          </van-card>
        </div>
        <template #right>
          <van-button square type="danger" text="删除" class="delete-button" />
        </template>
      </van-swipe-cell>
      <van-swipe-cell>
        <div class="cartListItem">
          <div class="checkbox"><van-checkbox v-model="checked" checked-color="#ee0a24"></van-checkbox></div>
          <van-card price="2.00" thumb="https://img01.yzcdn.cn/vant/ipad.jpeg">
            <template #title>
              <span class="buy">特价抢购中 </span>
              <span class="beforeEnd"> 距离优惠结束</span>
              <span class="end">5天13小时</span>
            </template>
            <template #desc>
              <div class="desc"><span class="discount">限时优惠</span></div>
            </template>
            <template #num>
              <van-stepper v-model="value" />
            </template>
          </van-card>
        </div>
        <template #right>
          <van-button square type="danger" text="删除" class="delete-button" />
        </template>
      </van-swipe-cell>
    </div>
    <van-submit-bar :price="3050" button-text="提交订单" @submit="onSubmit" class="check">
      <van-checkbox v-model="checked">全选</van-checkbox>
    </van-submit-bar>
  </div>
</template>

<script>
export default {
  name: "Cart",
  data() {
    return {
      checked: false,
    };
  },
  methods: {
    onSubmit() {},
  },
};
</script>
<style lang="less" scoped>
.delete-button {
  height: 100%;
}
.cart {
  background-color: #eee;
  .fixed {
    position: fixed;
    z-index: 99;
    top: 0;
    .header {
      background-color: #fff;
      width: 10rem;
      top: 0;
      padding: 0 15px;
      height: 43.9988px;
      display: flex;
      justify-content: space-between;
      border-bottom: 0.0267rem solid #eee;
      box-sizing: border-box;
      .left {
        font-size: 18px;
        line-height: 43.9988px;
      }
      .right {
        font-size: 15px;
        color: red;
        line-height: 43.9988px;
        .edit {
          color: #333;
          margin-left: 15px;
        }
      }
    }
  }
  .servicePolicy {
    margin-top: 43.9988px;
    font-size: 12px;
    height: 34.9988px;
    background-color: #eee;
    padding: 0 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #666;
    i {
      width: 0.26rem;
      height: 0.25rem;
      background-image: url(https://yanxuan-static.nosdn.127.net/hxm/yanxuan-wap/p/20161201/style/img/icon-normal/servicePolicy-de15fb68d3.png?imageView&type=webp);
      display: inline-block;
      background-repeat: no-repeat;
      transform: scale(0.5);
    }
  }
  .ad {
    background-color: #fff;
    height: 1.9467rem;
    margin-bottom: 0.2667rem;
    .promotion {
      padding: 0.2667rem 0.4rem;
      display: flex;
      justify-content: space-between;
      align-items: center;
      .left {
        background-color: #fc865f;
        background-image: linear-gradient(-225deg, #fc865f 0, #fc625f 100%);
        border-radius: 0.04rem;
        padding: 0 0.08rem;
        line-height: 0.32rem;
        font-size: 0.32rem;
        text-align: center;
        color: #fff;
        margin: 0 0.16rem 0 0.04rem;
        white-space: nowrap;
        -webkit-flex-shrink: 0;
        -moz-flex-shrink: 0;
        -ms-flex-negative: 0;
        flex-shrink: 0;
        display: inline-block;
        height: 0.4267rem;
        line-height: 0.4267rem;
      }
      .mid {
        flex: 1;
        font-size: 0.3733rem;
      }
      .right {
        color: red;
        font-size: 0.32rem;
      }
    }
    .change {
      margin: 0 0.4rem 0.1333rem 1.1467rem;
      padding: 0 0.2667rem;
      background-image: linear-gradient(-225deg, rgba(252, 134, 95, 0.05), rgba(252, 98, 95, 0.05) 100%);
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 0.32rem;
      height: 0.7467rem;
    }
  }
  .cartList {
    margin-bottom: 2.6667rem;
    .cartListItem {
      background-color: #fff;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-bottom: 0.2667rem;
      span {
        margin-right: 0.1333rem;
      }
      .checkbox {
        width: 0.8rem;
        position: relative;
        left: 0.1867rem;
      }

      .buy {
        border: 0.01rem solid #f48f18;
        border-radius: 0.04rem;
        font-size: 0.2rem;
        color: #f48f18;
        line-height: 0.3rem;
        padding: 0 0.08rem;
        font-family: PingFangSC-Regular;
      }
      .end {
        font-weight: bold;
      }
      .desc {
        margin-top: 0.1333rem;
        .discount {
          color: #f48f18;
        }
      }
    }
  }
  .check {
    margin-bottom: 1.3333rem;
  }
}
</style>
